<template>
  <BasicModal v-bind="$attrs" @register="registerModal" :footer="null"  title="详情" width="60%" destroyOnClose>
    <Description :column="1" :data="dataInfo" :schema="formSchema" />
  </BasicModal>
</template>
<script lang="ts" setup>
import { ref, useAttrs } from 'vue';
import { formSchema } from '../../../investment/TInputsList/TInputs.data';
import { Description, useDescription } from '/@/components/Description';
import BasicModal from "/@/components/Modal/src/BasicModal.vue";
import {useModalInner} from "/@/components/Modal";
const emit = defineEmits(['register']);
const attrs = useAttrs();
const dataInfo = ref({});
const  formSchema =  [
  {
    label: '模板名称',
    field: 'templateName',
  },
  {
    label: '投入品',
    field: 'input_dictText',
  },
  {
    label: '用法与用量',
    field: 'usageAndDosage',
  },
  {
    label: '作业类型',
    field: 'productionOperation_dictText',
  },
  {
    label: '作业工艺说明',
    field: 'operationDescription',
  },
  {
    label: '作业开始时间',
    field: 'jobStartTime',
  },
  {
    label: '作业周期',
    field: 'jobDuration',
  },
  {
    label: '作业工艺',
    field: 'jobIntroduce',
  },
  {
    label: '是否临时安排',
    field: 'randomJob_dictText',
  },
  {
    // 需要使用租户用户
    label: '计划操作人',
    field: 'jobby_dictText',
  },
  {
    label: '种植计划',
    field: 'growPlanId',
  },
]
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
  setModalProps({ confirmLoading: false });
  console.log(data);
  dataInfo.value = data.record;
  if (data.record.sysUser) {
    dataInfo.value.jobby_dictText = data.record.sysUser.realname;
  }else {
    dataInfo.value.jobby_dictText = ''
  }
  console.log(dataInfo.value);
});
</script>
